home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / xFrame_Use2065195112007.psc / xFrame UserControl / UserControls / xFrame.ctl
Text File  |  2007-05-11  |  42KB  |  1,032 lines

  1. VERSION 5.00
  2. Begin VB.UserControl xFrame 
  3.    ClientHeight    =   495
  4.    ClientLeft      =   0
  5.    ClientTop       =   0
  6.    ClientWidth     =   1920
  7.    ControlContainer=   -1  'True
  8.    ScaleHeight     =   495
  9.    ScaleWidth      =   1920
  10.    ToolboxBitmap   =   "xFrame.ctx":0000
  11. End
  12. Attribute VB_Name = "xFrame"
  13. Attribute VB_GlobalNameSpace = False
  14. Attribute VB_Creatable = True
  15. Attribute VB_PredeclaredId = False
  16. Attribute VB_Exposed = False
  17.     '****************************************************************
  18.     ' Project:      Creates an Ownerdrawn Frame control
  19.     ' Programmer:   Alexander Mungall
  20.     ' UserControl:  xFrame
  21.     ' Email:        goober_mpc@hotmail.com
  22.     '----------------------------------------------------------------
  23.     ' xFrame Copyright⌐ Alexander Mungall, All Rights Reserved
  24.     ' Feel free to use this code for personal use in anyway you see
  25.     ' fit, but please give credit where credit is due...
  26.     ' It's all I ask.
  27.     '****************************************************************
  28.     Option Explicit
  29.     
  30.     ' Booleans
  31.     Private bDisplayPicture As Boolean
  32.     Private bEnableGradient As Boolean
  33.     Private bExpanded As Boolean
  34.     Private bFontBold As Boolean
  35.     Private bFontItalic As Boolean
  36.     Private bFontStrikeThru As Boolean
  37.     Private bFontUnderline As Boolean
  38.     Private bFrameButton As Boolean
  39.     Private bFrameButtonPin As Boolean
  40.     Private bPaintHeader As Boolean
  41.     Private bPinned As Boolean
  42.     Private bMouseOver As Boolean
  43.     Private bMouseOverButtonPin As Boolean
  44.     Private bVerifyEnabledGradient As Boolean
  45.     
  46.     ' Controls
  47.     Private imgFramePic As Image
  48.     Private WithEvents picHeader As PictureBox
  49. Attribute picHeader.VB_VarHelpID = -1
  50.     Private WithEvents tmrMouseMove As Timer
  51. Attribute tmrMouseMove.VB_VarHelpID = -1
  52.     
  53.     ' Doubles
  54.     Private dFontSize As Double
  55.     
  56.     ' Enums
  57.     Public Enum xFrameStyles
  58.         xpDefault = 0
  59.         xpBlue = 1
  60.         xpOliveGreen = 2
  61.         xpSilver = 3
  62.     End Enum
  63.     Private m_ColorSchemes As xFrameStyles
  64.     
  65.     ' Events
  66.     Event Click()
  67.     Event DblClick()
  68.     Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  69.     Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  70.     Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  71.  
  72.     ' Integers
  73.     Private iNumControls As Integer
  74.     
  75.     ' Longs
  76.     Private Col As Long
  77.     Private lBottomR As Long
  78.     Private lBottomG As Long
  79.     Private lBottomB As Long
  80.     Private lTopR As Long
  81.     Private lTopG As Long
  82.     Private lTopB As Long
  83.     Private lUserControlOrigHeight As Long
  84.     Private m_ArrowColor As Long
  85.     Private m_ArrowHighlightedColor As Long
  86.     Private m_ArrowOverColor As Long
  87.     Private m_ButtonColour As Long
  88.     Private m_BorderColor As Long
  89.     Private m_CaptionColor As Long
  90.     Private m_GradientBottom As Long
  91.     Private m_GradientTop As Long
  92.     Private m_HeaderGradientBottom As Long
  93.     Private m_HeaderGradientTop As Long
  94.     
  95.     ' Strings
  96.     Private sFrameCaption As String
  97.     
  98.     ' Types
  99.     Private Type POINTAPI
  100.         X As Long
  101.         Y As Long
  102.     End Type
  103.     
  104.     ' Functions
  105.     Private Declare Function WindowFromPointXY Lib "user32" Alias "WindowFromPoint" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
  106.     Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  107.     
  108.     '****************************************************************
  109.     ' Gradient Code: Written by Mark Gordon (msg555)
  110.     '----------------------------------------------------------------
  111.     ' Copyright⌐ Mark Gordon, All Rights Reserved
  112.     '----------------------------------------------------------------
  113.     Private Declare Function CreateBitmap Lib "gdi32.dll" (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, ByRef lpBits As Any) As Long
  114.     Private Declare Function GetDIBits Lib "gdi32" (ByVal hdc As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long
  115.     Private Declare Function SetDIBits Lib "gdi32" (ByVal hdc As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long
  116.     
  117.     Private Const DIB_RGB_COLORS = 0&
  118.     Private Const BI_RGB = 0&
  119.     
  120.     Private Type BITMAPINFOHEADER '40 bytes
  121.        biSize As Long
  122.        biWidth As Long
  123.        biHeight As Long
  124.        biPlanes As Integer
  125.        biBitCount As Integer
  126.        biCompression As Long
  127.        biSizeImage As Long
  128.        biXPelsPerMeter As Long
  129.        biYPelsPerMeter As Long
  130.        biClrUsed As Long
  131.        biClrImportant As Long
  132.     End Type
  133.     
  134.     Private Type RGBQUAD
  135.        rgbBlue As Byte
  136.        rgbGreen As Byte
  137.        rgbRed As Byte
  138.        rgbReserved As Byte
  139.     End Type
  140.     
  141.     Private Type BITMAPINFO
  142.       bmiHeader As BITMAPINFOHEADER
  143.       bmiColors As RGBQUAD
  144.     End Type
  145.     
  146.     Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (lpPictDesc As PictDesc, riid As Guid, ByVal fPictureOwnsHandle As Long, iPic As StdPicture) As Long
  147.     Private Type PictDesc
  148.         cbSizeofStruct As Long
  149.         picType As Long
  150.         hImage As Long
  151.         xExt As Long
  152.         yExt As Long
  153.     End Type
  154.     Private Type Guid
  155.         Data1 As Long
  156.         Data2 As Integer
  157.         Data3 As Integer
  158.         Data4(0 To 7) As Byte
  159.     End Type
  160.     
  161.     Private Enum Blends
  162.         RGBBlend = 0
  163.         HSLBlend = 1
  164.     End Enum
  165.  
  166. Private Function CreateGradient(Width As Long, Height As Long, LeftToRight As Boolean, LeftTopColor As Long, RightBottomColor As Long, BlendType As Blends) As StdPicture
  167.     Dim hBmp As Long, Bits() As Byte
  168.     Dim RS As Byte, GS As Byte, BS As Byte 'Start RGB
  169.     Dim RE As Byte, GE As Byte, BE As Byte 'End RGB
  170.     Dim HS As Single, SS As Single, LS As Single 'Start HSL
  171.     Dim HE As Single, SE As Single, LE As Single 'End HSL
  172.     Dim Rc As Byte, GC As Byte, BC As Byte 'Current iteration RGB
  173.     Dim X As Long, Y As Long
  174.     ReDim Bits(0 To 3, 0 To Width - 1, 0 To Height - 1)
  175.     
  176.     RgbCol LeftTopColor, RS, GS, BS
  177.     RgbCol RightBottomColor, RE, GE, BE
  178.     
  179.     If BlendType = RGBBlend Then
  180.         If LeftToRight Then
  181.             For X = 0 To Width - 1
  182.                 Rc = (1& * RS - RE) * ((Width - 1 - X) / (Width - 1)) + RE
  183.                 GC = (1& * GS - GE) * ((Width - 1 - X) / (Width - 1)) + GE
  184.                 BC = (1& * BS - BE) * ((Width - 1 - X) / (Width - 1)) + BE
  185.                 For Y = 0 To Height - 1
  186.                     Bits(2, X, Y) = Rc
  187.                     Bits(1, X, Y) = GC
  188.                     Bits(0, X, Y) = BC
  189.                 Next
  190.             Next
  191.         Else
  192.             For Y = 0 To Height - 1
  193.                 Rc = (1& * RS - RE) * ((Height - 1 - Y) / (Height - 1)) + RE
  194.                 GC = (1& * GS - GE) * ((Height - 1 - Y) / (Height - 1)) + GE
  195.                 BC = (1& * BS - BE) * ((Height - 1 - Y) / (Height - 1)) + BE
  196.                 For X = 0 To Width - 1
  197.                     Bits(2, X, Y) = Rc
  198.                     Bits(1, X, Y) = GC
  199.                     Bits(0, X, Y) = BC
  200.                 Next
  201.             Next
  202.         End If
  203.     ElseIf BlendType = HSLBlend Then
  204.         RGBToHSL RS, GS, BS, HS, SS, LS
  205.         RGBToHSL RE, GE, BE, HE, SE, LE
  206.         If LeftToRight Then
  207.             For X = 0 To Width - 1
  208.                 HSLToRGB (1& * HS - HE) * ((Width - 1 - X) / (Width - 1)) + HE, _
  209.                         (1& * SS - SE) * ((Width - 1 - X) / (Width - 1)) + SE, _
  210.                         (1& * LS - LE) * ((Width - 1 - X) / (Width - 1)) + LE, _
  211.                         Rc, GC, BC
  212.                 For Y = 0 To Height - 1
  213.                     Bits(2, X, Y) = Rc
  214.                     Bits(1, X, Y) = GC
  215.                     Bits(0, X, Y) = BC
  216.                 Next
  217.             Next
  218.         Else
  219.             For Y = 0 To Height - 1
  220.                 HSLToRGB (1& * HS - HE) * ((Height - 1 - Y) / (Height - 1)) + HE, _
  221.                         (1& * SS - SE) * ((Height - 1 - Y) / (Height - 1)) + SE, _
  222.                         (1& * LS - LE) * ((Height - 1 - Y) / (Height - 1)) + LE, _
  223.                         Rc, GC, BC
  224.                 For X = 0 To Width - 1
  225.                     Bits(2, X, Y) = Rc
  226.                     Bits(1, X, Y) = GC
  227.                     Bits(0, X, Y) = BC
  228.                 Next
  229.             Next
  230.         End If
  231.     End If
  232.  
  233.     Dim BI As BITMAPINFO
  234.     With BI.bmiHeader
  235.         .biSize = Len(BI.bmiHeader)
  236.         .biWidth = Width
  237.         .biHeight = -Height
  238.         .biPlanes = 1
  239.         .biBitCount = 32
  240.         .biCompression = BI_RGB
  241.         .biSizeImage = ((((.biWidth * .biBitCount) + 31) \ 32) * 4) * Abs(.biHeight)
  242.     End With
  243.     hBmp = CreateBitmap(Width, Height, 1&, 32&, ByVal 0)
  244.     SetDIBits 0&, hBmp, 0, Abs(BI.bmiHeader.biHeight), Bits(0, 0, 0), BI, DIB_RGB_COLORS
  245.  
  246.     Dim IGuid As Guid, PicDst As PictDesc
  247.     With IGuid
  248.         .Data1 = &H7BF80980
  249.         .Data2 = &HBF32
  250.         .Data3 = &H101A
  251.         .Data4(0) = &H8B
  252.         .Data4(1) = &HBB
  253.         .Data4(2) = &H0
  254.         .Data4(3) = &HAA
  255.         .Data4(4) = &H0
  256.         .Data4(5) = &H30
  257.         .Data4(6) = &HC
  258.         .Data4(7) = &HAB
  259.     End With
  260.     With PicDst
  261.         .cbSizeofStruct = Len(PicDst)
  262.         .hImage = hBmp
  263.         .picType = vbPicTypeBitmap
  264.     End With
  265.     OleCreatePictureIndirect PicDst, IGuid, True, CreateGradient
  266. End Function
  267.  
  268. 'Helper Functions
  269. Private Sub RgbCol(Col As Long, ByRef R As Byte, ByRef G As Byte, ByRef B As Byte)
  270.     R = Col And &HFF&
  271.     G = (Col And &HFF00&) \ &H100&
  272.     B = (Col And &HFF0000) \ &H10000
  273. End Sub
  274.  
  275. Private Sub RGBToHSL(ByVal R As Byte, ByVal G As Byte, ByVal B As Byte, H As Single, S As Single, L As Single)
  276.     'http://www.vbAccelerator.com
  277.     Dim Max As Single
  278.     Dim Min As Single
  279.     Dim delta As Single
  280.     Dim rR As Single, rG As Single, rB As Single
  281.  
  282.     rR = R / 255: rG = G / 255: rB = B / 255
  283.  
  284.     '{Given: rgb each in [0,1].
  285.     ' Desired: h in [0,360] and s in [0,1], except if s=0, then h=UNDEFINED.}
  286.     Max = Maximum(rR, rG, rB)
  287.     Min = Minimum(rR, rG, rB)
  288.     L = (Max + Min) / 2    '{This is the lightness}
  289.     '{Next calculate saturation}
  290.     If Max = Min Then
  291.         'begin {Acrhomatic case}
  292.         S = 0
  293.         H = 0
  294.         'end {Acrhomatic case}
  295.     Else
  296.         'begin {Chromatic case}
  297.              '{First calculate the saturation.}
  298.         If L <= 0.5 Then
  299.             S = (Max - Min) / (Max + Min)
  300.         Else
  301.             S = (Max - Min) / (2 - Max - Min)
  302.         End If
  303.         
  304.         '{Next calculate the hue.}
  305.         delta = Max - Min
  306.         If rR = Max Then
  307.             H = (rG - rB) / delta    '{Resulting color is between yellow and magenta}
  308.         ElseIf rG = Max Then
  309.             H = 2 + (rB - rR) / delta '{Resulting color is between cyan and yellow}
  310.         ElseIf rB = Max Then
  311.             H = 4 + (rR - rG) / delta '{Resulting color is between magenta and cyan}
  312.         End If
  313.         'Debug.Print h
  314.         'h = h * 60
  315.         'If h < 0# Then
  316.         '     h = h + 360            '{Make degrees be nonnegative}
  317.         'End If
  318.     'end {Chromatic Case}
  319.     End If
  320. 'end {RGB_to_HLS}
  321. End Sub
  322.  
  323. Private Sub HSLToRGB(ByVal H As Single, ByVal S As Single, ByVal L As Single, R As Byte, G As Byte, B As Byte)
  324.     'http://www.vbAccelerator.com
  325.     Dim rR As Single, rG As Single, rB As Single
  326.     Dim Min As Single, Max As Single
  327.     
  328.     If S = 0 Then
  329.         ' Achromatic case:
  330.         rR = L: rG = L: rB = L
  331.     Else
  332.         ' Chromatic case:
  333.         ' delta = Max-Min
  334.         If L <= 0.5 Then
  335.             'S = (Max - Min) / (Max + Min)
  336.             ' Get Min value:
  337.             Min = L * (1 - S)
  338.         Else
  339.             'S = (Max - Min) / (2 - Max - Min)
  340.             ' Get Min value:
  341.             Min = L - S * (1 - L)
  342.         End If
  343.         ' Get the Max value:
  344.         Max = 2 * L - Min
  345.        
  346.         ' Now depending on sector we can evaluate the h,l,s:
  347.         If (H < 1) Then
  348.             rR = Max
  349.             If (H < 0) Then
  350.                 rG = Min
  351.                 rB = rG - H * (Max - Min)
  352.             Else
  353.                 rB = Min
  354.                 rG = H * (Max - Min) + rB
  355.             End If
  356.         ElseIf (H < 3) Then
  357.             rG = Max
  358.             If (H < 2) Then
  359.                 rB = Min
  360.                 rR = rB - (H - 2) * (Max - Min)
  361.             Else
  362.                 rR = Min
  363.                 rB = (H - 2) * (Max - Min) + rR
  364.             End If
  365.         Else
  366.             rB = Max
  367.             If (H < 4) Then
  368.                 rR = Min
  369.                 rG = rR - (H - 4) * (Max - Min)
  370.             Else
  371.                 rG = Min
  372.                 rR = (H - 4) * (Max - Min) + rG
  373.             End If
  374.         End If
  375.     End If
  376.     R = rR * 255: G = rG * 255: B = rB * 255
  377. End Sub
  378.  
  379. Private Function Maximum(rR As Single, rG As Single, rB As Single) As Single
  380.      'http://www.vbAccelerator.com
  381.     If (rR > rG) Then
  382.         If (rR > rB) Then
  383.             Maximum = rR
  384.         Else
  385.             Maximum = rB
  386.         End If
  387.     Else
  388.         If (rB > rG) Then
  389.             Maximum = rB
  390.         Else
  391.             Maximum = rG
  392.         End If
  393.     End If
  394. End Function
  395.  
  396. Private Function Minimum(rR As Single, rG As Single, rB As Single) As Single
  397.      'http://www.vbAccelerator.com
  398.     If (rR < rG) Then
  399.         If (rR < rB) Then
  400.             Minimum = rR
  401.         Else
  402.             Minimum = rB
  403.         End If
  404.     Else
  405.         If (rB < rG) Then
  406.             Minimum = rB
  407.         Else
  408.             Minimum = rG
  409.         End If
  410.     End If
  411. End Function
  412.     
  413. ' Get and Set all the properties with this control
  414. Public Property Get BackColor() As OLE_COLOR
  415.     BackColor = UserControl.BackColor
  416. End Property
  417.  
  418. Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
  419.     UserControl.BackColor = New_BackColor
  420.     PropertyChanged "BackColor"
  421.     Call UserControl_Paint
  422. End Property
  423.  
  424. Public Property Get BorderColor() As OLE_COLOR
  425.     BorderColor = m_BorderColor
  426. End Property
  427.  
  428. Public Property Let BorderColor(ByVal New_BorderColor As OLE_COLOR)
  429.     m_BorderColor = New_BorderColor
  430.     PropertyChanged "BorderColor"
  431.     Call UserControl_Paint
  432. End Property
  433.  
  434. Public Property Get Button() As Boolean
  435.     Button = bFrameButton
  436. End Property
  437.  
  438. Public Property Let Button(ByVal new_Button As Boolean)
  439.     bFrameButton = new_Button
  440.     PropertyChanged "Button"
  441.     Call UserControl_Paint
  442. End Property
  443.  
  444. Public Property Get ButtonColor() As OLE_COLOR
  445.     ButtonColor = m_ArrowColor
  446. End Property
  447.  
  448. Public Property Let ButtonColor(ByVal New_ButtonColor As OLE_COLOR)
  449.     m_ArrowColor = New_ButtonColor
  450.     PropertyChanged "ButtonColor"
  451.     Call UserControl_Paint
  452. End Property
  453.  
  454. Public Property Get ButtonHighlightColor() As OLE_COLOR
  455.     ButtonHighlightColor = m_ArrowHighlightedColor
  456. End Property
  457.  
  458. Public Property Let ButtonHighlightColor(ByVal New_ButtonHighlightColor As OLE_COLOR)
  459.     m_ArrowHighlightedColor = New_ButtonHighlightColor
  460.     PropertyChanged "ButtonHighlightColor"
  461.     Call UserControl_Paint
  462. End Property
  463.  
  464. Public Property Get ButtonPin() As Boolean
  465.     ButtonPin = bFrameButtonPin
  466. End Property
  467.  
  468. Public Property Let ButtonPin(ByVal New_ButtonPin As Boolean)
  469.     bFrameButtonPin = New_ButtonPin
  470.     PropertyChanged "ButtonPin"
  471.     Call UserControl_Paint
  472. End Property
  473.  
  474. Public Property Get Caption() As String
  475.     Caption = sFrameCaption
  476. End Property
  477.  
  478. Public Property Let Caption(ByVal New_TheCaption As String)
  479.     sFrameCaption = New_TheCaption
  480.     PropertyChanged "Caption"
  481.     Call UserControl_Paint
  482. End Property
  483.  
  484. Public Property Get ColorScheme() As xFrameStyles
  485.     ColorScheme = m_ColorSchemes
  486. End Property
  487.  
  488. Public Property Let ColorScheme(val As xFrameStyles)
  489.     ' Determine which color scheme has been selected
  490.     m_ColorSchemes = val
  491.  
  492.     ' Set the colour scheme
  493.     Call SelectColorScheme
  494.  
  495.     If bEnableGradient = True Then
  496.         bVerifyEnabledGradient = False
  497.         Set UserControl.Picture = Nothing
  498.     End If
  499.  
  500.     ' Repaint the control
  501.     Call UserControl_Paint
  502. End Property
  503.  
  504. Public Property Get DisplayPicture() As Boolean
  505.     DisplayPicture = bDisplayPicture
  506. End Property
  507.  
  508. Public Property Let DisplayPicture(ByVal new_DisplayPicture As Boolean)
  509.     bDisplayPicture = new_DisplayPicture
  510.     PropertyChanged "DisplayPicture"
  511.     Call UserControl_Resize
  512. End Property
  513.  
  514. Public Property Get Enabled() As Boolean
  515.     Enabled = UserControl.Enabled
  516. End Property
  517.  
  518. Public Property Let Enabled(ByVal new_enabled As Boolean)
  519.     UserControl.Enabled() = new_enabled
  520.     PropertyChanged "Enabled"
  521.     
  522.     ' Set the Enabled state of all controls within the Frame
  523.     Dim UserCtrl As Object
  524.     For Each UserCtrl In UserControl.ContainedControls
  525.         UserCtrl.Enabled = new_enabled
  526.     Next
  527.  
  528.     ' Set the colour scheme
  529.     Call SelectColorScheme
  530.     
  531.     If bEnableGradient = True Then
  532.         bVerifyEnabledGradient = False
  533.         Set UserControl.Picture = Nothing
  534.     End If
  535.     
  536.     Call UserControl_Paint
  537. End Property
  538.  
  539. Public Property Get EnableGradient() As Boolean
  540.     EnableGradient = bEnableGradient
  541. End Property
  542.  
  543. Public Property Let EnableGradient(ByVal New_EnableGradient As Boolean)
  544.     bEnableGradient = New_EnableGradient
  545.     PropertyChanged "EnableGradient"
  546.     
  547.     If bEnableGradient = False Then
  548.         bVerifyEnabledGradient = False
  549.         Set UserControl.Picture = Nothing
  550.     End If
  551.     
  552.     ' Set the colour scheme
  553.     Call SelectColorScheme
  554.     Call UserControl_Paint
  555. End Property
  556.  
  557. Public Property Get Expanded() As Boolean
  558.     Expanded = bExpanded
  559. End Property
  560.  
  561. Public Property Let Expanded(ByVal New_Expanded As Boolean)
  562.     bExpanded = New_Expanded
  563.     PropertyChanged "Expanded"
  564.     
  565.     If bPinned = False Then
  566.         If bExpanded = False Then 'lUserControlOrigHeight = UserControl.Height Then
  567.             UserControl.Height = 315
  568.         Else
  569.             UserControl.Height = lUserControlOrigHeight
  570.         End If
  571.     End If
  572.     bPaintHeader = False
  573.     Call picHeader_Paint
  574. End Property
  575.  
  576. Public Property Get Font() As Font
  577.     Set Font = picHeader.Font
  578. End Property
  579.  
  580. Public Property Set Font(ByVal New_Font As Font)
  581.     Set picHeader.Font = New_Font
  582.     bFontBold = picHeader.FontBold
  583.     bFontItalic = picHeader.FontItalic
  584.     dFontSize = picHeader.FontSize
  585.     bFontStrikeThru = picHeader.FontStrikethru
  586.     bFontUnderline = picHeader.FontUnderline
  587.     Call UserControl_Resize
  588.     PropertyChanged "Font"
  589. End Property
  590.  
  591. Public Property Get ForeColor() As OLE_COLOR
  592.     ForeColor = picHeader.ForeColor
  593. End Property
  594.  
  595. Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
  596.     picHeader.ForeColor() = New_ForeColor
  597.     m_CaptionColor = New_ForeColor
  598.     PropertyChanged "ForeColor"
  599. End Property
  600.  
  601. Public Property Get FramePinned() As Boolean
  602.     FramePinned = bPinned
  603. End Property
  604.  
  605. Public Property Let FramePinned(ByVal New_FramePinned As Boolean)
  606.     bPinned = New_FramePinned
  607.     PropertyChanged "FramePinned"
  608.     Call UserControl_Paint
  609. End Property
  610.  
  611. Public Property Get GradientBottom() As OLE_COLOR
  612.    GradientBottom = m_GradientBottom
  613. End Property
  614.  
  615. Public Property Let GradientBottom(ByVal New_GradientBottom As OLE_COLOR)
  616.     m_GradientBottom = New_GradientBottom
  617.     PropertyChanged "GradientBottom"
  618.  
  619.     If bEnableGradient = True Then
  620.         bVerifyEnabledGradient = False
  621.         Set UserControl.Picture = Nothing
  622.     End If
  623.  
  624.     ' Repaint the control
  625.     Call UserControl_Paint
  626. End Property
  627.  
  628. Public Property Get GradientTop() As OLE_COLOR
  629.    GradientTop = m_GradientTop
  630. End Property
  631.  
  632. Public Property Let GradientTop(ByVal New_GradientTop As OLE_COLOR)
  633.     m_GradientTop = New_GradientTop
  634.     PropertyChanged "GradientTop"
  635.  
  636.     If bEnableGradient = True Then
  637.         bVerifyEnabledGradient = False
  638.         Set UserControl.Picture = Nothing
  639.     End If
  640.  
  641.     ' Repaint the control
  642.     Call UserControl_Paint
  643. End Property
  644.  
  645. Public Property Get HeaderGradientBottom() As OLE_COLOR
  646.    HeaderGradientBottom = m_HeaderGradientBottom
  647. End Property
  648.  
  649. Public Property Let HeaderGradientBottom(ByVal New_HeaderGradientBottom As OLE_COLOR)
  650.     m_HeaderGradientBottom = New_HeaderGradientBottom
  651.     PropertyChanged "HeaderGradientBottom"
  652.     bPaintHeader = False
  653.     picHeader.Cls
  654.     picHeader_Paint
  655. End Property
  656.  
  657. Public Property Get HeaderGradientTop() As OLE_COLOR
  658.     HeaderGradientTop = m_HeaderGradientTop
  659. End Property
  660.  
  661. Public Property Let HeaderGradientTop(ByVal New_HeaderGradientTop As OLE_COLOR)
  662.     m_HeaderGradientTop = New_HeaderGradientTop
  663.     PropertyChanged "HeaderGradientTop"
  664.     bPaintHeader = False
  665.     picHeader.Cls
  666.     picHeader_Paint
  667. End Property
  668.  
  669. Public Property Get Picture() As Picture
  670.     Set Picture = imgFramePic.Picture
  671. End Property
  672.  
  673. Public Property Set Picture(ByVal New_Picture As Picture)
  674.     Set imgFramePic.Picture = New_Picture
  675.     PropertyChanged "Picture"
  676.     bDisplayPicture = True
  677.     Call UserControl_Resize
  678.     bPaintHeader = False
  679.     Call picHeader_Paint
  680. End Property
  681.  
  682. Private Sub picHeader_Click()
  683.     If bMouseOver = True And bFrameButton = True Then
  684.         If bPinned = False Then
  685.             If lUserControlOrigHeight = UserControl.Height Then
  686.                 UserControl.Height = 315
  687.                 bExpanded = False
  688.             Else
  689.                 UserControl.Height = lUserControlOrigHeight
  690.                 bExpanded = True
  691.             End If
  692.         End If
  693.         bPaintHeader = False
  694.         Call picHeader_Paint
  695.     ElseIf bMouseOverButtonPin = True And bFrameButtonPin = True Then
  696.         If bPinned = False Then
  697.             bPinned = True
  698.         Else
  699.             bPinned = False
  700.         End If
  701.     End If
  702.     
  703.     PropertyChanged "Expanded"
  704.     
  705.     ' Invokes the Click Event
  706.     RaiseEvent Click
  707. End Sub
  708.  
  709. Private Sub picHeader_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  710.     If bMouseOver Then
  711.         If X < (picHeader.Width - 450) Or X > (picHeader.Width - 300) Then
  712.             Exit Sub
  713.         End If
  714.     End If
  715.     If bFrameButton = True Then
  716.         If X < (picHeader.Width - 450) Or X > (picHeader.Width - 300) Then
  717.             bMouseOver = True
  718.             bMouseOverButtonPin = False
  719.         Else
  720.             bMouseOver = False
  721.             bMouseOverButtonPin = True
  722.         End If
  723.     Else
  724.         bMouseOver = False
  725.         bMouseOverButtonPin = True
  726.     End If
  727.     tmrMouseMove.Enabled = True
  728.     bPaintHeader = False
  729.     Call picHeader_Paint
  730. End Sub
  731.  
  732. Private Sub picHeader_Paint()
  733.     ' Paints the Frame header and label
  734.     If bPaintHeader = False Then
  735.         ' Set the Frame header bottom colour
  736.         Col = m_HeaderGradientBottom
  737.         lBottomR = (Col And &HFF&)
  738.         lBottomG = (Col And &HFF00&) / &H100
  739.         lBottomB = (Col And &HFF0000) / &H10000
  740.         
  741.         ' Set the Frame header top colour
  742.         Col = m_HeaderGradientTop
  743.         lTopR = (Col And &HFF&)
  744.         lTopG = (Col And &HFF00&) / &H100
  745.         lTopB = (Col And &HFF0000) / &H10000
  746.         
  747.         ' Clear the Header for drawing and apply the gradient colour
  748.         picHeader.Cls
  749.         Set picHeader.Picture = CreateGradient(picHeader.Width / Screen.TwipsPerPixelX, picHeader.Height / Screen.TwipsPerPixelY, False, RGB(lTopR, lTopG, lTopB), RGB(lBottomR, lBottomG, lBottomB), RGBBlend)
  750.  
  751.         ' Display the Text and Icon
  752.         picHeader.FontBold = bFontBold
  753.         picHeader.FontItalic = bFontItalic
  754.         If dFontSize = 0 Then
  755.             dFontSize = 8
  756.         Else
  757.             picHeader.FontSize = dFontSize
  758.         End If
  759.         picHeader.FontStrikethru = bFontStrikeThru
  760.         picHeader.FontUnderline = bFontUnderline
  761.         If bDisplayPicture = False Then
  762.             picHeader.CurrentX = 75
  763.         Else
  764.             picHeader.CurrentX = imgFramePic.Width + 75
  765.             picHeader.ScaleMode = 1
  766.             picHeader.PaintPicture imgFramePic.Picture, 15, 15, imgFramePic.Width, imgFramePic.Height
  767.         End If
  768.         picHeader.CurrentY = (picHeader.Height - picHeader.TextHeight(sFrameCaption)) / 2
  769.         picHeader.ForeColor = m_CaptionColor
  770.         picHeader.Print sFrameCaption
  771.  
  772.         ' Draw the Pin Button if the user has selected this option
  773.         If bFrameButtonPin = True Then
  774.             If bMouseOverButtonPin = False Then
  775.                 m_ButtonColour = m_ArrowColor
  776.             Else
  777.                 m_ButtonColour = m_ArrowOverColor
  778.             End If
  779.             
  780.             If bFrameButton = True Then
  781.                 If bPinned = False Then
  782.                     picHeader.Line (picHeader.Width - 435, 135)-(picHeader.Width - 390, 135), m_ButtonColour
  783.                     picHeader.Line (picHeader.Width - 390, 90)-(picHeader.Width - 390, 195), m_ButtonColour
  784.                     picHeader.Line (picHeader.Width - 390, 105)-(picHeader.Width - 315, 105), m_ButtonColour
  785.                     picHeader.Line (picHeader.Width - 390, 155)-(picHeader.Width - 315, 155), m_ButtonColour
  786.                     picHeader.Line (picHeader.Width - 390, 170)-(picHeader.Width - 315, 170), m_ButtonColour
  787.                     picHeader.Line (picHeader.Width - 315, 105)-(picHeader.Width - 315, 180), m_ButtonColour
  788.                 Else
  789.                     picHeader.Line (picHeader.Width - 390, 75)-(picHeader.Width - 330, 75), m_ButtonColour
  790.                     picHeader.Line (picHeader.Width - 390, 75)-(picHeader.Width - 390, 150), m_ButtonColour
  791.                     picHeader.Line (picHeader.Width - 345, 75)-(picHeader.Width - 345, 150), m_ButtonColour
  792.                     picHeader.Line (picHeader.Width - 330, 75)-(picHeader.Width - 330, 150), m_ButtonColour
  793.                     picHeader.Line (picHeader.Width - 415, 150)-(picHeader.Width - 280, 150), m_ButtonColour
  794.                     picHeader.Line (picHeader.Width - 360, 150)-(picHeader.Width - 360, 210), m_ButtonColour
  795.                 End If
  796.             Else
  797.                 If bPinned = False Then
  798.                     picHeader.Line (picHeader.Width - 255, 135)-(picHeader.Width - 210, 135), m_ButtonColour
  799.                     picHeader.Line (picHeader.Width - 210, 90)-(picHeader.Width - 210, 195), m_ButtonColour
  800.                     picHeader.Line (picHeader.Width - 210, 105)-(picHeader.Width - 135, 105), m_ButtonColour
  801.                     picHeader.Line (picHeader.Width - 210, 155)-(picHeader.Width - 135, 155), m_ButtonColour
  802.                     picHeader.Line (picHeader.Width - 210, 170)-(picHeader.Width - 135, 170), m_ButtonColour
  803.                     picHeader.Line (picHeader.Width - 135, 105)-(picHeader.Width - 135, 180), m_ButtonColour
  804.                 Else
  805.                     picHeader.Line (picHeader.Width - 210, 75)-(picHeader.Width - 150, 75), m_ButtonColour
  806.                     picHeader.Line (picHeader.Width - 210, 75)-(picHeader.Width - 210, 150), m_ButtonColour
  807.                     picHeader.Line (picHeader.Width - 165, 75)-(picHeader.Width - 165, 150), m_ButtonColour
  808.                     picHeader.Line (picHeader.Width - 150, 75)-(picHeader.Width - 150, 150), m_ButtonColour
  809.                     picHeader.Line (picHeader.Width - 235, 150)-(picHeader.Width - 100, 150), m_ButtonColour
  810.                     picHeader.Line (picHeader.Width - 180, 150)-(picHeader.Width - 180, 210), m_ButtonColour
  811.                 End If
  812.             End If
  813.         End If
  814.         
  815.         ' Draw the button if the user has selected this option
  816.         If bFrameButton = True Then
  817.             Dim i As Integer
  818.             Dim iHorizontal1 As Integer
  819.             Dim iHorizontal2 As Integer
  820.             Dim iVertical As Integer
  821.             
  822.             If bMouseOver = False Then
  823.                 m_ButtonColour = m_ArrowColor
  824.             Else
  825.                 m_ButtonColour = m_ArrowOverColor
  826.             End If
  827.             
  828.             If lUserControlOrigHeight = UserControl.Height Then
  829.                 iHorizontal1 = 195
  830.                 iHorizontal2 = 180
  831.                 iVertical = 75
  832.                 For i = 1 To 2
  833.                     ' 1st Line of Arrow
  834.                     picHeader.Line (picHeader.Width - iHorizontal1, iVertical)-(picHeader.Width - (iHorizontal1 - 15), iVertical), m_ButtonColour
  835.                     iVertical = iVertical + 15
  836.                     
  837.                     ' 2nd Line of Arrow
  838.                     picHeader.Line (picHeader.Width - (iHorizontal1 + 15), iVertical)-(picHeader.Width - (iHorizontal1 - 30), iVertical), m_ButtonColour
  839.                     iVertical = iVertical + 15
  840.                     
  841.                     ' 3rd Line of Arrow
  842.                     picHeader.Line (picHeader.Width - (iHorizontal1 + 30), iVertical)-(picHeader.Width - iHorizontal1, iVertical), m_ButtonColour
  843.                     picHeader.Line (picHeader.Width - iHorizontal2, iVertical)-(picHeader.Width - (iHorizontal2 - 30), iVertical), m_ButtonColour
  844.                     iVertical = iVertical + 15
  845.                     
  846.                     ' 4th Line of Arrow
  847.                     picHeader.Line (picHeader.Width - (iHorizontal1 + 45), iVertical)-(picHeader.Width - (iHorizontal1 + 15), iVertical), m_ButtonColour
  848.                     picHeader.Line (picHeader.Width - (iHorizontal2 - 15), iVertical)-(picHeader.Width - (iHorizontal2 - 45), iVertical), m_ButtonColour
  849.                     iVertical = iVertical + 15
  850.                 Next
  851.             Else
  852.                 iHorizontal1 = 195 '210
  853.                 iHorizontal2 = 180 '195
  854.                 iVertical = 75
  855.                 For i = 1 To 2
  856.                     ' 1st Line of Arrow
  857.                     picHeader.Line (picHeader.Width - (iHorizontal1 + 45), iVertical)-(picHeader.Width - (iHorizontal1 + 15), iVertical), m_ButtonColour
  858.                     picHeader.Line (picHeader.Width - (iHorizontal2 - 15), iVertical)-(picHeader.Width - (iHorizontal2 - 45), iVertical), m_ButtonColour
  859.                     iVertical = iVertical + 15
  860.                 
  861.                     ' 2nd Line of Arrow
  862.                     picHeader.Line (picHeader.Width - (iHorizontal1 + 30), iVertical)-(picHeader.Width - iHorizontal1, iVertical), m_ButtonColour
  863.                     picHeader.Line (picHeader.Width - iHorizontal2, iVertical)-(picHeader.Width - (iHorizontal2 - 30), iVertical), m_ButtonColour
  864.                     iVertical = iVertical + 15
  865.                     
  866.                     ' 3rd Line of Arrow
  867.                     picHeader.Line (picHeader.Width - (iHorizontal1 + 15), iVertical)-(picHeader.Width - (iHorizontal1 - 30), iVertical), m_ButtonColour
  868.                     iVertical = iVertical + 15
  869.                     
  870.                     ' 4th Line of Arrow
  871.                     picHeader.Line (picHeader.Width - iHorizontal1, iVertical)-(picHeader.Width - (iHorizontal1 - 15), iVertical), m_ButtonColour
  872.                     iVertical = iVertical + 15
  873.                 Next
  874.             End If
  875.         End If
  876.             
  877.         ' Draw a line at the bottom of the Frame header
  878.         picHeader.Line (0, picHeader.Height - 30)-(picHeader.Width, picHeader.Height - 30), UserControl.BackColor 'UserControl.Ambient.BackColor
  879.         picHeader.ZOrder 0
  880.         
  881.         ' Set the Frame header caption colour
  882.         picHeader.ForeColor = m_CaptionColor
  883.         bPaintHeader = True
  884.     End If
  885. End Sub
  886.  
  887. Private Sub SelectColorScheme()
  888.     If UserControl.Enabled = False Then
  889.         m_ArrowColor = &H759797
  890.         m_ArrowHighlightedColor = &HCFCFCF
  891.         m_BorderColor = &H80A7BF
  892.         m_CaptionColor = &H759797
  893.         m_GradientBottom = &HF8FAFA
  894.         m_GradientTop = &HFFFFFF
  895.         m_HeaderGradientBottom = &H90ABAB
  896.         m_HeaderGradientTop = &HE0E7E7
  897.     Else
  898.         Select Case m_ColorSchemes
  899.             Case xpDefault
  900.                 m_ArrowColor = &H0&
  901.                 m_ArrowHighlightedColor = &HAFAFAF
  902.                 m_BorderColor = &HCFCFCF
  903.                 m_CaptionColor = &H0&
  904.                 m_GradientBottom = &HEFEFEF
  905.                 m_GradientTop = &HFFFFFF
  906.                 m_HeaderGradientBottom = &HCFCFCF
  907.                 m_HeaderGradientTop = &HF8F8F8
  908.             Case xpBlue
  909.                 m_ArrowColor = &HBB6132
  910.                 m_ArrowHighlightedColor = &HFFFFFF
  911.                 m_picHeader.Width -OcHe m_picHeader.Width -Oc c c c c c c c c c c c c
  912.  hted4 c c c c c c c c c            Set UserControl.PcHe m_picHeaBi0ed4 c c c csd4 c c c csd4 c c c csdp7Xub picHeacsd4 c c c csdpob picHeacsd4 c r1B l.Pc csdFalse Then            Set UserControl.PBi0eTx           userControl.PBi0eTx           userControrAhteeh1a&orAEtrol.PBi0eTx    lmSelectColorSchemeen
  913.           i        rrowb3Then            Set UsyGraesr             m_Gradienta, picHeader.Heizonvt
  914.     CallPBi0eTx    usEallPBi0eTx    usEall   End  Property Let ForeColor(llPBi0eTx    0eTx    0eTx    0eTx olour
  915.    iByropBi        m_ButAFA
  916.         m_Gradien.erty Let.10),rColor Y, m_ButAFA
  917.         m_Gradien.,et.10),r            cHeacsd4 c g              t UrB100
  918.   SQ       t UrB100
  919.   SQ       t UrB10 g              t UrB100o9   usEallPBi0eTx    usEall        m_BorderColor = &Ho=rizontal1 + 30),    Case xpDe &Hp0      
  920.         ' S    m_HserCl.PBGCase xpDe &Hp0      tdD7
  921. Bi0M      t ( usEallPBi0eTx    usEall  t ( usEallPBi0eTxfeButtonf
  922. E c c c c            Set UserControl.f
  923.     
  924.     Call UserControl_Paint
  925. End Property
  926.  
  927. Public Property Get EnableGradient(r   Call UserControl_PainBorderColor = usEallPBi0eTxfeButtonf1=lor =erColor = EfeButtonf1=lor T_PainBorderColoruttonf1=lor T_Pa        T_Ph          Setn"
  928.     Call UserControl_Paint"
  929.     CaERrol_Paint"
  930. roperty
  931.  
  932. Public Property Get E t UrB100
  933.   SQ       t Ur + d Prm_Boe Property Get EwoFFFFFF
  934. ader.W_Pa   t a O iVert+ d Prm_Boe Pr,or = &H75r.W_Pa   tUserControl.Pl   r = adientBottom =elta = Max-Min
  935.         If L B('icHeaderUserControl_Resizeaturation.}
  936.        pT n.}
  937.        pT n.oreColor() As         Max-Min
  938.         Ifs    r = adientBottom =elta =4 m_pSee Property Gl)-(picHadi      Els Priv t+ 30),  =elta = M)-(picHeader.Width - (iHreColcpicHadi      Els Priv t+ 30), l.caroperty
  939.  
  940. Public Pro9(picelta =4 m_pSee Propert        userControl.PB   eol.P00oI"serC'=        m_picHFFF
  941.                i Ne=o2E Su   Width - lta =4 m_pSe_picHFFF
  942.              
  943.       T_Ph     Po    Els Priv t+ 30      
  944.       T_Ph          eoGradientBfs    r = adientBoeentB  Max-MdFF
  945. + 30),  =elta = MB  Max-MB,  =elt     iv t+ w =4 Ider.Width /cHeader.Width - (iHorils Priv t+r.Width ReaBi0ed4 c c c cs =4 m_pSe_picHFFF
  946.              
  947.       T_Ph     Po    Els Priv t+ 30      
  948.     PO.iVert+ d        
  949.       T_Ph     ntrol_RlrtO          Head_Boe Property GetiiHeader.Wp     l UserControl_Pain9y Let.10SV   PO.i.Wp     l User     l UserCont   mmmmmmmmmmmmmmmmmmmm4m.ci          HeaSee( usEallPBi0eTx  roperty
  950.  
  951. PubliorAhin9y Let.10SV   PO.i.Wp   i0ed4 c C&t5riv s                 ' 1st Line of  roperty  l User     l UserContke / &H100
  952.         lBottv s                 ' 1st Lio    'u   
  953.   Ss   lPBi0eTxfeButtonf1=lor =erColor = EfeButtonf1=lor T_PainBorderColoroBith R(0eTxfeButtonf1=lor =erCoeader.FontBoldF    m_ButtonColourdABsd If=lor T_n8h Epnt   mmmmmPO.iVerhic Property Get EnablerserCommmmmPO.iVerhic Property Get EnablerserCommmmmPO.iVerhic Property Get Enar.FontBoldF    RPO.iV           ' 1st Lio    'u   
  954.   Ss   lPBi0eiGe_picHFFy Get Enable9Lio3cWidth - 255, 135)-(picHeader.Width -()_PainO.iVerhic Pbnt   mmmmmPO.iVerhic ProhAFAF
  955.                 m_BorderCo iHorizontpv s            vntal1 -   m__picHFFy Get Enable9Lio3cWidth - 2559Lio3cWidth - 2559Li  m__i          HeaSeeGet Enabler6ty Get EwoFFFFFF
  956. adercWidth -EnablerrrrEs                  ntal1 -   m__picH1PO.iVerhic m__tal1 - our
  957.  R(0e
  958. aderchLNerteA5tal1 - our
  959.  R(0e
  960. aderchLNerteA5tal1  m__pi
  961. aicHo i Ne=o2E Su   Widm_Bu=Get1PO.iVerC- ou0.Height         m_GrO.iVerhic Pbnt   mmmmmPO.iVerhic ProhAFAF
  962.          B"aottonf1=lor =erColor = EfeButtooln         userContro0     ' S    m_Hsere
  963.     PropertyChanged "Picture"
  964.     bDisplayPicture = Trhn.}
  965.        pT n.}
  966.        pT n.oreColor() As         Max-Min
  967.         Ifs    r =H er.WidtaBIfs    r =H er.WidtaBIfs    r =H er.WiN PropertyChGet1PO.iVerC- ou   PropertyChangererC- aintH
  968.    et UserControl.P ain      m_picHFFF
  969.  naa =    picHeader.Line (picHeantO          Head_Bt  =e= lUserContro25serConwrCo, 105)-(picHeader.Widthiertl  Proa30 25serConwrCo, 105)-(picHeader.icHe
  970.         Select 
  971.     PropertyChant   erCo iHorizon
  972.   SQ       t Ur + d Prm_Boe Property Get EwUr + d Prm_Boe PcHe
  973.         Select 
  974.  Properta   mPO.iVerhic PropertXicture = new_DisplayPoBertXicturH     Next
  975.  playPictureEaBIfs    r =H er.WidtaBIfs    r =H er.WiN 5, 135)-(picHeader.Width -Eh -Eh -Eh)-(picHeader.her.her.cBytxPropertXictu.her.her.cBytdAerUXictu pT Ar.Line (picHeantO          Head_BPu pT Ar.Line (picHeantO          Head_BPu pT Ar.Line (picHeantO          Head_BPu pT Ar.Line (picHlseIf (Hbh)-(B:  Head_BPu ientr.Line (picHeantO          Head_BPu pT Ar.Line (picHlseIf (Hbh)-(B:  Head_BPu   PropertyChant 0eTxVPC
  976.    h)-(     
  977.      Head_BPu pT  m_H          If lUserControlOrAe (picHeantO          Head_BPu pT Ar.Line l*hant 0e7 Ar.LloEtaBIfs    r 5n
  978.         Ifs    r =H er.WidtaBIfs   Pr4g  erCo iHorizon
  979.   SQ       t Ur + d Prm_Boe Property Get EwUr + d Prm_Boe PcHe
  980.         Select 
  981.  Properta   mPO.iVerhic PropertXicture = new_DisplayPoBertXicturH     Next
  982.  playPictureEaBIfs    r =H er.WidtaBIfs    r =H er.WiN 5, 135)-(picHeader.Widths    r =O          Head_BPu pT Ar.B lUserControlOrAe (picHeantO       , picHeader.HeizcHeantO       , picHeader."UserControlOrAe (picHeaead_BPu pT  m_Hol_PainoserControlOrAe (picHeaead_BPu pT  m_Hol_PainoserCs-ropertXictureeng  erCo iu   .lor T_n8h Epnt   mmmmmPO.iVerhic Property Get EnablerserCommmmmPO.iVerhic Property Get EnablerserClrCommmmmPO.iVerh         End If
  983.       g.l)-(picHeader.Width - (iHorizEtO          HeadrBColor = m_CapBrizEtO  c9 HeightIR hth - (iHorizEtO  NTead   mmmmmPO.iVerhic Property Get EnablerserCommmmmPO.iVerhic Property Get EnablerserClrCommmmmPO.iVerh         End If
  984.       g.l)-(picHeader.Width - (iHorizEtO          Hblerrrr75
  985.                 For i = 1 To 2
  986.                 (picHeader.Widths    r =O7opertblerserCommmmmPO.iVerhic Property mPO.iVerh s  s    r =O7Fy PropertyFy PropertyFy Pro7Fy PropertyFy PropertyFy Pro7Fy PropertyFy PropertyFy Pro7Fy PropertyFy iVertical),nablerserCteA5tal1 -XEnd der.WidthsgHeight = UserControl.Height - (iHorizoHeight -mPO.iVerh         End If
  987.       g.l)-(y PropertyFy ProEnd If
  988.  End If
  989.       Cr.Witrol_PtlerserCteA5taldIf (Hbr=
  990.      &H100
  991.         lBontrol.Height - (iHori.Sk=H er.WidtaBIfs    9l.H r =O7opertfs    9l.H   r =O7opertblerserCO.iVerhic PropeHeigCteht -mPO.iVerh         End If
  992.       g.l)-Os0 If
  993.  snd If
  994.       g.l)-Os0 If
  995. O  c9 HeightIR hth - (iHori Line ofl    at
  996.      Ifs    r =H ButtonColour = m_A)Bht
  997.         End If
  998.         picHeader.Currtr Trhn.}
  999.     = 1 To t=3 c9 HeightIR hth - (iHori Line ofl    atSa_BPu pT  m_Hol_onColour = m_A)Bht
  1000.         End If
  1001.         6  NTearB1nd If
  1002.       g.l)-Os0 IfHead_BPu pT Ar.Line (picg      Setn"
  1003.  uth -Oc c c cidtaBB0 If
  1004. O  c9 Heightde15
  1005.              LBTeeng  erCo iu   .lHFFF
  1006.  naa = 
  1007.     = 1 To t=3 c9 HeightIR hth - (iHori Line ofl    atSa_BP1   = 1lori Line ofl    atSa_BP1   = 1tBP1   = 1lulne ofl    atSa_r = m_CapBrizEtO
  1008.  
  1009. Public PropertlerserCteA5taldIf (Hbr=
  1010.      eht -mPO.iVerh         End If3FSPropertlxelX, picHeader.Height / Screen.TwhaldIf (Hbr=a= 1lxertXiceigCteht -mPO.iVerh         End If
  1011.       g.l)-Os0 If
  1012.  snd If
  1013.           xherwNo"
  1014. roperty
  1015. rhnt -mPO.iVerh           xherwNo"
  1016. roperty
  1017. rhnt -mPO.iVerh t -mdeht -mPO.iVProper55taldIf (Hbr=
  1018.      eht -mPO.iVerh pertyFyyyyr=  g.l)-Os0 =yyyr=  g.l)-Os0 =yyyr=  g.l)-Os0 =yyyr=  g.l)-Os0 =w8
  1019. roperty
  1020. rhnt -GMO.    atSa_BP1   9c   eht -0      lBottomG =p    atSa_BP1   uttonHighllBottomG =p    atSa_BP1   uttonHighllBottomG =lerserClrCommmmhrClrCommmmhrCghllBottom    atSa_r = m_CapBriz9aLine l*hant 0e7 AAAAAAAAAAAAAAAAAAAAAAAAAAAArTwhaldo_.pertXicture = new_DisplayPoBertXicturH     Next
  1021.  playPictureEaBIfs    rAAAAg  erperty
  1022. r (picHeantO          Head_BPu pT Ar.Line (picHlseIf (Hbhhhhhhh O. Cdth pT Ar.LiaWidthsgHei"osCdth pT Ar.rhhhh O. Cdth p(picg      Setn"
  1023.  uthne l*hant 0e7 AA   h - iHorizontal1, iVertiwUr bVertiwUr bVertiwUr bVertiwUrw h - iHC.Line (picdth h -Eh)-(picHeadatSa_BP1   uiz9aLine l*hant 0e7 AAAAAAAAA.rserCommmmmPOg.l)-Os0 =yyyc C&t5riv s  =l*hanAe (picHeaead_BPu A. Cdth pTeet UserControl.PcHe m_picHeaBi0ed4 c c c csdrtblerserC l*hc C&t5riv s  =l*ha(Ifs    rAAAAg  etProperty 4 c c"hsgHei"osCdth pT,' iVertiwUr bVertiwUr bVertiwU uthneLine l*hant 0e7 AAAAAAAAA.rserCEperty Get9l
  1024. ChoArtiwUr bVe"osCdth pT,' iVtSa_BP1   uttonHighllBottomG =(_ bVertiertiwmmmPOg.l)-Os0 =yyyc C&t5riAingle, Y As Sin A. Cdth pTIfs    rAAAAg  erperty
  1025. r (picHeantO          Heaead_BPuo - 2559i+ d Prm_Boe Property Get EwUr +  c c"hsgHei"osCdtuo - 2559i+ d Prm_Boe ProperCteht -mPO.iVerh - 2559i+ d Prm_Boe ProperCteht -mPO.Sb    =yr=  g.l)-Os0r +  c c"hsgHei"osCdtuo - 2559i+ d Prty
  1026. r (picHeantO       1  m__p(ht -0      lBottomG =p  Cdtuo -SrAAAAgkp11ttomG =p  Cdtuo -SrAAAAgkp11ttomG =pty
  1027. r (picHeRAPu pT Ar.Lpwmmc"hsgHei"p:rrc"hsgHei"p:rr_BPuo      D     picHei"p:rr_BPuo      D     picHei"p:rr_BPuo      D     picHei"p:rr_BPuo   e
  1028. r (picHeicHei"pfr_BPuo   e
  1029. r  =yr=HeicHei"pfr_BPuo h userContro0     '=  g.l)-Os Line of Ar  lBottomG =p  CdtuoeHei"p:rrc"h1    He        "p:rr_BPuo   t:rr_BP(udtuoeHei"p:r(f Ar  lBotsCdtuo - 2559i+ d Prhaldo_.pertXicture = new_DisplayPoBertXicturH     Next
  1030.  playPictureEaBIfs    rAAAAg  erperty
  1031. r (picHeantO          Head_BPu pT Ar.Line (picHlseIf (Hbhhhhhhh O. Cdth pT Ar.LiaWidthsgHei"osCdth pT Ar.rhhhh O. Cdth p(picg      Setn"
  1032.  uthne l*harCommmmmPOg.l)-Os0 =yyyc C&t5riv s  =l*hanAe (picHeaead_BPu A. Cdth pTeet UserCi_BPu A. Cdth pTeet UserCi_BPu A. Cdth pTeeteet